import java.util.Arrays;
public class MycopyOf {
    public static int[] MycopyOf(int[] array,int length)
    {
        int[] newarray=new int[array.length];

        for(int i=0;i<array.length;i++)
        {
            newarray[i]=array[i];
        }
        return newarray;
    }

    public static void main(String[] args)
    {
        int[] array={1,2,3,4,5};
        int [] newArray=MycopyOf(array,array.length);
        System.out.println("newArray:"+Arrays.toString(newArray));
    }
}
